﻿using System;
using GalaSoft.MvvmLight;
using MVVM_CAD.Model;

namespace MVVM_CAD.ViewModel
{
    public class FigureActionViewModel : ViewModelBase
    {
        #region Members
        #region SelectedFigure Property
        /// <summary>
        /// The <see cref="SelectedFigure" /> property's name.
        /// </summary>
        public const string SelectedFigurePropertyName = "SelectedFigure";
        private IFigure _selectedFigure = null;

        
        /// <summary>
        /// Gets the SelectedFigure property.
        /// TODO Update documentation:
        /// Changes to that property's value raise the PropertyChanged event. 
        /// This property's value is broadcasted by the Messenger's default instance when it changes.
        /// </summary>
        public IFigure SelectedFigure
        {
            get
            {
                return _selectedFigure;
            }

            set
            {
                if (_selectedFigure == value)
                {
                    return;
                }

                _selectedFigure = value;
                RaisePropertyChanged(SelectedFigurePropertyName);
            }
        }
        #endregion
        #endregion

        #region Constructor
        public FigureActionViewModel(IFigure figure)
        {
            SelectedFigure = figure;
            #region DataDesignTime
            //if (IsInDesignMode)
            //{

            //}
            //else
            //{
            //    // Code runs "for real"
            //}
            #endregion
        }
        #endregion
    }
}
